package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {

    /**
     * 根据商品分类名称查询规格列表
     * @param name
     * @return
     */
    @Select("select s.name,s.options from tb_spec s,tb_template t,tb_category c where s.template_id = t.id and t.id and c.template_id and c.name=#{name}")
    List<Map> selectByCategoryName(@Param("name") String name);

}
